<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

name: <input type="text" name="name" id="name"> <br>
age:   <input type="text" name="age" id="age"> <br>
<button onclick="post()">post</button>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
    function post(){
        var name = $('#name').val();
        var age = $('#age').val();
        var data = {name: name, age: age};
        $.ajax({
            url: '/v1/test/info',
            type: 'POST',
            dataType: 'json',
            data: JSON.stringify(data),
            contentType: "application/json;charset=UTF-8",
            error: function (e) {
                var res = e.responseJSON;
                var httpStatus = e.status;
            },
            success: function (d) {
                console.log(d)
            }
        })
        console.log(data);
    }
</script>
</body>
</html>